<?php

namespace GamesBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @author  coffey  <coffey@nligo.com>
 * UserScoreTopUpLog
 *
 * 用户保险柜分数记录
 *
 * @ORM\Table(name="user_score_topup_log")
 * @ORM\Entity(repositoryClass="GamesBundle\Repository\UserScoreTopUpLogRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class UserScoreTopUpLog
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false,options={"comment":"分数记录ID"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="oper_score", type="decimal", precision=10, scale=2, nullable=false,options={"comment":"操作分数值"})
     */
    private $operScore = '0.00';

    /**
     * @var string
     *
     * @ORM\Column(name="now_score", type="decimal", precision=10, scale=2, nullable=false,options={"comment":"操作完成以后的分数"})
     */
    private $nowScore = '0.00';

    /**
     * @ORM\ManyToOne(targetEntity="User")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    private $userId;

    /**
     * @var integer
     *
     * @ORM\Column(name="oper_at", type="integer", nullable=false,options={"comment":"操作时间"})
     */
    private $operAt = '0';

    /**
     * @var string
     *
     * @ORM\Column(name="oper_msg", type="string", length=255, nullable=false,options={"comment":"操作备注"})
     */
    private $operMsg = '';

    /**
     * @var integer
     *
     * @ORM\Column(name="withdrawal_status", type="integer", nullable=false,options={"comment":"提现状态 0为无操作 1为提现审核中 2为通过    3为拒绝"})
     */
    private $withdrawalStatus = '0';


    /**
     * @var integer
     *
     * @ORM\Column(name="score_type", type="integer", nullable=false,options={"comment":"类型 1为提取 2为存入 默认为1"})
     */
    private $scoreType = '1';

    /**
     * @ORM\PrePersist
     */
    public function PrePersist(){
        $this->setOperAt(time());
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set operScore
     *
     * @param string $operScore
     *
     * @return UserScoreTopUpLog
     */
    public function setOperScore($operScore)
    {
        $this->operScore = $operScore;

        return $this;
    }

    /**
     * Get operScore
     *
     * @return string
     */
    public function getOperScore()
    {
        return $this->operScore;
    }

    /**
     * Set nowScore
     *
     * @param string $nowScore
     *
     * @return UserScoreTopUpLog
     */
    public function setNowScore($nowScore)
    {
        $this->nowScore = $nowScore;

        return $this;
    }

    /**
     * Get nowScore
     *
     * @return string
     */
    public function getNowScore()
    {
        return $this->nowScore;
    }

    /**
     * Set operAt
     *
     * @param integer $operAt
     *
     * @return UserScoreTopUpLog
     */
    public function setOperAt($operAt)
    {
        $this->operAt = $operAt;

        return $this;
    }

    /**
     * Get operAt
     *
     * @return integer
     */
    public function getOperAt()
    {
        return $this->operAt;
    }

    /**
     * Set operMsg
     *
     * @param string $operMsg
     *
     * @return UserScoreTopUpLog
     */
    public function setOperMsg($operMsg)
    {
        $this->operMsg = $operMsg;

        return $this;
    }

    /**
     * Get operMsg
     *
     * @return string
     */
    public function getOperMsg()
    {
        return $this->operMsg;
    }

    /**
     * Set withdrawalStatus
     *
     * @param integer $withdrawalStatus
     *
     * @return UserScoreTopUpLog
     */
    public function setWithdrawalStatus($withdrawalStatus)
    {
        $this->withdrawalStatus = $withdrawalStatus;

        return $this;
    }

    /**
     * Get withdrawalStatus
     *
     * @return integer
     */
    public function getWithdrawalStatus()
    {
        return $this->withdrawalStatus;
    }

    /**
     * Set userId
     *
     * @param \GamesBundle\Entity\User $userId
     *
     * @return UserScoreTopUpLog
     */
    public function setUserId(\GamesBundle\Entity\User $userId = null)
    {
        $this->userId = $userId;

        return $this;
    }

    /**
     * Get userId
     *
     * @return \GamesBundle\Entity\User
     */
    public function getUserId()
    {
        return $this->userId;
    }

    /**
     * Set scoreType
     *
     * @param integer $scoreType
     *
     * @return UserScoreTopUpLog
     */
    public function setScoreType($scoreType)
    {
        $this->scoreType = $scoreType;

        return $this;
    }

    /**
     * Get scoreType
     *
     * @return integer
     */
    public function getScoreType()
    {
        return $this->scoreType;
    }
}
